# $Id: PKGBUILD 167931 2012-10-03 20:46:27Z andrea $
# Maintainer:
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Angel 'angvp' Velasquez <angvp[at]archlinux.com.ve> 

pkgbase=pycurl
pkgname=('python2-pycurl')
pkgver=7.19.0
pkgrel=2
arch=('i686' 'x86_64')
url="http://pycurl.sourceforge.net/"
license=('GPL')
makedepends=('python2' 'curl')
source=("http://pycurl.sourceforge.net/download/${pkgbase}-${pkgver}.tar.gz")
md5sums=('919d58fe37e69fe87ce4534d8b6a1c7b')

package_python2-pycurl() {
  pkgdesc="A Python 2.x interface to libcurl"
  depends=('python2' 'curl')
  replaces=('pycurl' 'python-pycurl')
  provides=('pycurl' 'python-pycurl')
  conflicts=('python-pycurl')

  cd ${pkgbase}-${pkgver}
  python2 setup.py install --curl-config=/usr/bin/curl-config \
    --prefix "${pkgdir}"/usr --optimize=1

  sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
    -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
    $(find "${pkgdir}" -name '*.py')
}
